package com.api.shopapi.service.impl;


import com.api.shopapi.entity.Cart;
import com.api.shopapi.mapper.CartMapper;
import com.api.shopapi.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author maochuan
 */
@Service("CartServiceImplOne")
public class CartServiceImpl implements CartService {
    @Autowired
    private CartMapper cartMapper;
    @Override
    public int insert(Cart cart) {
        return cartMapper.insert(cart);
    }

    @Override
    public int update(Cart cart) {
        return cartMapper.update(cart);
    }

    @Override
    public int delete(String cartCode) {
        return cartMapper.delete(cartCode);
    }

    @Override
    public List<Cart> getList() {
        return cartMapper.getList();
    }

    @Override
    public Cart getByCartCode(String cartCode) {
        return cartMapper.getByCartCode(cartCode);
    }

    @Override
    public Cart getByUserCodeBusinessTopCode(String userCode, String businessTopCode){
        return cartMapper.getByUserCodeBusinessTopCode(userCode,businessTopCode);
    }

    @Override
    public Cart getByUserCodeGovernmentCode(String userCode, String governmentCode){
        return cartMapper.getByUserCodeGovernmentCode(userCode,governmentCode);
    }


}
